package com.hue;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.vod.model.v20170321.DeleteVideoRequest;

/*
    删除视频
 */
public class VoeTest4 {
    public static void main(String[] args) throws ClientException {
        DefaultAcsClient client = initVodClient("LTAI5t77KMd1pNDZKer4Wuko", "EvDRXaj0Vc4JybCtrvxwEuVIp1ufuP");
        //批量删除视频的请求
        DeleteVideoRequest request = new DeleteVideoRequest();
        request.setVideoIds("221e97a4eadc45229e9da3817535e800");
        //删除视频并返回结果
        client.getAcsResponse(request);
    }

    //连接vod
    public static DefaultAcsClient initVodClient(String accessKeyId, String accessKeySecret) throws ClientException {
        String regionId = "cn-shanghai";  // 点播服务接入区域
        DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
        DefaultAcsClient client = new DefaultAcsClient(profile);
        return client;
    }
}
